import 'package:flutter_test/flutter_test.dart';
import 'package:stripe_terminal_tap_to_pay/stripe_terminal_tap_to_pay.dart';
import 'package:stripe_terminal_tap_to_pay/stripe_terminal_tap_to_pay_platform_interface.dart';
import 'package:stripe_terminal_tap_to_pay/stripe_terminal_tap_to_pay_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockStripeTerminalTapToPayPlatform
    with MockPlatformInterfaceMixin
    implements StripeTerminalTapToPayPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> init(String localId, String baseUrl) {
    // TODO: implement init
    throw UnimplementedError();
  }

  @override
  Future<Map> pay(String amount) {
    // TODO: implement pay
    throw UnimplementedError();
  }

  @override
  Future<bool> permissionAllowed() {
    // TODO: implement permissionAllowed
    throw UnimplementedError();
  }

  @override
  Future<bool> cancelRetrievePaymentIntent() {
    // TODO: implement cancelRetrievePaymentIntent
    throw UnimplementedError();
  }

  @override
  Future<Map> cancelProcessPayment() {
    // TODO: implement cancelProcessPayment
    throw UnimplementedError();
  }
}

void main() {
  final StripeTerminalTapToPayPlatform initialPlatform = StripeTerminalTapToPayPlatform.instance;

  test('$MethodChannelStripeTerminalTapToPay is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelStripeTerminalTapToPay>());
  });

  test('getPlatformVersion', () async {
    StripeTerminalTapToPay stripeTerminalTapToPayPlugin = StripeTerminalTapToPay();
    MockStripeTerminalTapToPayPlatform fakePlatform = MockStripeTerminalTapToPayPlatform();
    StripeTerminalTapToPayPlatform.instance = fakePlatform;

    expect(await stripeTerminalTapToPayPlugin.getPlatformVersion(), '42');
  });
}
